import functionnodes.FunctionNode;
import data.Value;

/**
 * @author loaner
 */
class functionnodes.FunctionNodeSetf extends FunctionNode {
	
	function FunctionNodeSetf() {
		super();
		funcname = "setf";
	}
	
	public function reduceValues( scope:Object, args:Array):Value
	{
		// first arg should be string telling us the name of the var to set
		// second arg should be the value.

		
		var varname:Value = args[0];
		
		
		trace("Here in setf, I'm setting " + varname + " to " + args[1] );
		trace("Is args[1] a Value object?" + (args[1] instanceof Value) );
		//varname, value, scope
		Evaluator.setInScope( scope, varname, args[1] );
		
		return args[1];
	}

}